<template>
    <yk-space size="xl" dir="vertical" class="file-view">
        <TopTitle name="本地文件" :is-search="false" style="width: 100%;" >
        <template #custom>
            <yk-space align="center">
                <yk-text type="third">图片、视频、音频大小不超过20M</yk-text>
                <yk-button>上传</yk-button>
            </yk-space>
        </template>
    </TopTitle>
    <Subset :classify="2" @nowSubset="nowSubset"></Subset> 
        <FilesVue :pageSize="16" :subsetId="nowSubsetId" :nowSubset="nowSubset" ></FilesVue>
    </yk-space>
</template>

<script setup lang="ts">
import {ref } from 'vue'
import TopTitle from '../components/bar/TopTitle.vue';
import FilesVue from '../components/files/files.vue';
import Subset from '../components/subset/subset.vue';
const nowSubsetId = ref<number>(-1) //当前分组id
const nowSubset = (e:{id: number, type:string}) => {
    if(e.type === 'all'){
        nowSubsetId.value = -1
    } else if(e.type === 'subset' || e.type==='exclude'){
        nowSubsetId.value = e.id
    }
} 
</script>

<style scoped lang="less">  
.file-view{
    width: 100%;
}
</style>